#Basic commnad to run epic
./bin/epic --seed=0 --scenario=example.xml
#Basic command to run the container
singularity exec --writable --containall --bind ./test/:/home/epic/test/ epic_partons ./../../home/epic/test/run.sh

BEFORE START ANY STEP, MAKE SURE YOU ARE ON THE /home/ directory

1. Singularity container. You can modify the .def file so all software that I install manually with "apt-get install", is done automatically.
	sudo singularity build --sandbox --writable-tmpfs epic_partons epic_partons.def
	sudo singularity shell --writable --containall epic_partons

	cd /
	mkdir work
	mkdir ceph24
	mkdir volatile	

	apt-get install language-pack-en-base
	locale
	export LANG=en_US.UTF-8
	export LC_CTYPE=en_US.UTF-8
	export LC_NUMERIC=en_US.UTF-8
	export LC_TIME=en_US.UTF-8	
	export LC_COLLATE=en_US.UTF-8
	export LC_MONETARY=en_US.UTF-8
	export LC_MESSAGES=en_US.UTF-8
	export LC_PAPER=en_US.UTF-8
	export LC_NAME=en_US.UTF-8
	export LC_ADDRESS=en_US.UTF-8
	export LC_TELEPHONE=en_US.UTF-8
	export LC_MEASUREMENT=en_US.UTF-8
	export LC_IDENTIFICATION=en_US.UTF-8

	chmod -R 777 /	
	apt-get update


1. Apfel++
	cd /home/
	git clone https://github.com/vbertone/apfelxx.git
	cd apfelxx
	mkdir build && cd build
	cmake ..
	make && make install
2. LHAPDF 6.5.4
	cd /home/
	wget https://lhapdf.hepforge.org/downloads/?f=LHAPDF-6.5.4.tar.gz -O LHAPDF-6.X.Y.tar.gz
	tar -xf LHAPDF-6.X.Y.tar.gz
	cd LHAPDF-6.5.4
	./configure --disable-python
	make
	make install		
	
3. ROOT:
	cd /home/
	wget https://root.cern/download/root_v6.26.14.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
	tar -xzvf root_v6.26.14.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
	source root/bin/thisroot.sh

	git clone https://github.com/root-project/root.git
	mkdir root-build && cd root-build
	cmake ../root \
	  -DCMAKE_INSTALL_PREFIX=/home/root \
	  -Dxrootd=OFF \
	  -Dfail-on-missing=OFF
	make -j$(nproc)
	make install  
  
4. CMake: 
	cd /home/
	wget https://github.com/Kitware/CMake/releases/download/v3.26.3/cmake-3.26.3.tar.gz
	tar -xf cmake-3.26.3.tar.gz 
	cd cmake-3.26.3
	./bootstrap -- -DCMAKE_USE_OPENSSL=OFF
	make
	make install
		

5. PARTONS: /home/
	cd /home/
	GIT_SSL_NO_VERIFY=true git clone https://drf-gitlab.cea.fr/partons/core/elementary-utils.git --branch release-v4 --depth 1
	GIT_SSL_NO_VERIFY=true git clone https://drf-gitlab.cea.fr/partons/core/numa.git --branch release-v4 --depth 1
	GIT_SSL_NO_VERIFY=true git clone https://drf-gitlab.cea.fr/partons/core/partons.git --branch release-v4 --depth 1
	GIT_SSL_NO_VERIFY=true git clone https://drf-gitlab.cea.fr/partons/core/partons-example.git --branch release-v4 --depth 1

	cd elementary-utils/build
	cmake -G"Unix Makefiles" ../ -DCMAKE_BUILD_TYPE=Debug
	make
	make install
	cd ../../numa/build
	cmake -G"Unix Makefiles" ../ -DCMAKE_BUILD_TYPE=Debug
	make
	make install
	cd ../../partons/build
	cmake -G"Unix Makefiles" ../ -DCMAKE_BUILD_TYPE=Debug
	make
	make install
	cd ../../partons-example/build
	cmake -G"Unix Makefiles" ../ -DCMAKE_BUILD_TYPE=Debug
	make
				
6. Install HepMC3: 
	#if you dont install it using ROOTIO it epic wont work
	cd /home/
	git clone https://gitlab.cern.ch/hepmc/HepMC3.git
	mkdir hepmc3-build
	cd hepmc3-build
	cmake -DHEPMC3_ENABLE_ROOTIO=OFF -DROOT_DIR=/home/root/ -DCMAKE_INSTALL_PREFIX=../hepmc3-install ../HepMC3
	export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/root/lib/
	make -j1 install

7. Boost
	cd /home/
	wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz
	tar -xf boost_1_81_0.tar.gz
	cd boost_1_81_0
	./bootstrap.sh 
	./b2 install --prefix=/usr/local/
	export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/boost_1_81_0/stage/lib

	
8. Install EPIC: /home/
	cd /home/
	git clone https://github.com/pawelsznajder/epic/
	cd epic/build/
	cmake -DCMAKE_PREFIX_PATH="/home/hepmc3-install/share/HepMC3/cmake" -DCMAKE_CXX_STANDARD=17 ..
	make
	
9. Final steps
	chmod -R 777 /work/
	touch /etc/localtime

